<%@page import="org.springframework.web.context.request.SessionScope"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link rel="stylesheet" href="/forestage/css/font-awesome.min.css">
<link rel="stylesheet" href="/forestage/css/bootstrap.min.css">
<link rel="stylesheet" href="/forestage/css/index.css">
<link rel="stylesheet" href="/forestage/css/regist.css">
<script src="/forestage/js/jquery.min.js"></script>
<script src="/forestage/js/bootstrap.min.js"></script>
<script src="/forestage/js/index.js"></script>
<title>主页</title>
</head>
<body>
	<header id="header">
		<nav id="top-nav">
			<div class="city">
				太原&nbsp;&nbsp;<small>更换</small>
			</div>
			<div class="login">
				<ul>
				    <li><a href="/index">首页</a></li>
					<li><a>欢迎&nbsp;&nbsp;<span style="color: red">${user.username}</span>&nbsp;,&nbsp;
					</a> <a href="/logout">注销</a></li>
					<li><a href="/regist.jsp">注册</a></li>
					<li><a href="#">我的订单</a></li>
					<li><a href="#">帮助中心</a></li>
				</ul>
			</div>
		</nav>
		<div class="logo">
			<div class="content">
				<div class="left">
					<img src="/forestage/img/logo.png" alt="logo" width="240px"
						height="90px" />
				</div>
				<div class="right">
					<img src="/forestage/img/ad.png" alt="广告" width="555px"
						height="89px" />
				</div>
			</div>
		</div>
		<nav id="nav">
			<ul class="menu">

			</ul>
		</nav>
	</header>

	<!--中间部分  列出电影信息。进行购买。-->
	<section id="main">
		<div class="style">
			<h1>请选择座位号：</h1>
		</div>
		<div class="row-fluid">
			<form method="post" action="/shopcar/add" class="form">
				<div class="well">
					<div class="guding">
					    <input type="hidden" name="userid" value="${sessionScope.user.userid}"> 
					    <input type="hidden" name="filmId" value="${id}"> 
						<label> buynum： </label> <input type="text" name="ordernum" id="num"
							maxlength="10" required="required"> 
						<input type="hidden" value="${kucun}" id="kucun"/>	<br /> 
						<input type="hidden" name="orderstate" value="0"> 	
						<input type="submit" class="btn btn-primary" value="加入购物车" />

						<div style="color: red">${msg}</div>
					</div>
				</div>
			</form>
		</div>
	</section>

	<!--脚-->
	<footer id="footer" style="position: absolute; bottom: 0;">
		<div class="other">
			<div class="other-content">
				<div class="other-left">
					<a href="#">联系我们</a> <a href="#">电影情报</a> <a href="#">友情链接</a>
				</div>
				<div class="other-right">
					<a href="#">万达集团</a> <a href="#">万达院线官网</a>
				</div>
			</div>
		</div>
		<div class="info">
			<p>Copyright © 2011-2013 Wandafilm.com ALL rights
				reserved&nbsp;&nbsp;&nbsp;&nbsp;冀ICP备13013593&nbsp;&nbsp;&nbsp;&nbsp;增值电信业务经营许可证B2-20130186
			</p>
		</div>
	</footer>
</body>
<script type="text/javascript">
  $(function(){
	  $("#num").change(function(){
		  var num = $(this).val();
		  var kucun = $("#kucun").val();
		  if(parseInt(num) > parseInt(kucun)){
			  $("#kucun").after("<span style='color:red'>库存不足</span>")
		  }
	  })
  })
</script>
</html>